@import "../../base.less";

@import "./_var.less";

.@{prefix}-slider {
  position: relative;
  height: @slider-hander-height + 6px;

  &__bar {
    position: absolute;
    width: 100%;
    top: 50%;
    margin-top: (-@slider-bar-height / 2);
    height: @slider-bar-height;
    background-color: @slider-bar-bg-color;
    transition: background-color .3s;
  }

  &__track {
    position: absolute;
    top: 50%;
    margin-top: (-@slider-bar-height / 2);
    height: @slider-bar-height;
    background-color: @slider-track-bg-color;
    transition: background-color .3s;
  }

  &__handle {
    position: absolute;
    top: 50%;
    width: @slider-hander-height;
    height: @slider-hander-width;
    margin-top: (-@slider-hander-height / 2);
    background-color: #fff;
    border: solid 1px #ddd;
    border-radius: 50%;
    transform: translateX(-50%);
    transition: border-color .3s, transform .3s cubic-bezier(.18, .89, .32, 1.28);

    &.@{prefix}-is-drawing {
      transform: scale(1.2);
    }
  }

  &__mark {
    position: absolute;
    top: -@slider-hander-height - 4px;
    left: 0;
    width: 100%;
    font-size: @slider-font-size-base;
    height: @slider-hander-height + 4px;

    &-text {
      position: absolute;
      display: inline-block;
      color: #888;
      text-align: center;
      word-break: keep-all;
      user-select: none;
      transform: translateX(-50%);
    }
  }

  &-wrap {
    display: flex;
    align-items: center;

    .@{prefix}-slider {
      flex: 1;
    }

    &__value {
      min-width: @spacer * 3;
      margin-left: @spacer * 1.5;
      flex-shrink: 0;
    }

    &.@{prefix}-is {
      &-mark {
        padding-top: @slider-hander-height + 4px;
      }

      &-disabled {
        opacity: .6;
        cursor: not-allowed;
      }
    }
  }
}

.@{prefix}-is-mark-slider {
  .t-cell--label {
    padding-top: @slider-hander-height + 4px;
  }
}
